package com.lingmeng.system.mapper;

import com.lingmeng.system.entity.Equipment;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 设备Mapper接口
 * 
 * @author lingmeng
 * @date 2024-07-18
 */
public interface EquipmentMapper 
{
    /**
     * 查询设备
     * 
     * @param id 设备主键
     * @return 设备
     */
    public Equipment selectEquipmentById(Long id);

    /**
     * 查询设备列表
     * 
     * @param equipment 设备
     * @return 设备集合
     */
    public List<Equipment> selectEquipmentList(Equipment equipment);

    /**
     * 新增设备
     * 
     * @param equipment 设备
     * @return 结果
     */
    public int insertEquipment(Equipment equipment);

    /**
     * 修改设备
     * 
     * @param equipment 设备
     * @return 结果
     */
    public int updateEquipment(Equipment equipment);

    /**
     * 删除设备
     * 
     * @param id 设备主键
     * @return 结果
     */
    public int deleteEquipmentById(Long id);

    /**
     * 批量删除设备
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteEquipmentByIds(Long[] ids);

    /**
     * 批量查询设备
     * @param ids
     * @return
     */
	List<Equipment> selectEquipmentsByIds(@Param("ids") List<Long> ids);

    @Select("select count(1) > 0 from equipment where mac = #{mac}")
    boolean selectExitByMac(String mac);
}
